package Demo;

import java.util.Scanner;

/**
 * @author mucd
 * 2021/3/10/010 下午 04:08
 */

public class Main extends IImplementation<User> implements IsFunction<User> {
    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(System.in);

        while (true) {
            System.out.println("*********************");
            System.out.println("  MySQL数据库管理");
            System.out.println("  输入使用的功能数字");
            System.out.println("1.插入数据 2.查看所有数据 3.修改用户名  4.删除数据 5.查询一条数据 0.exit");
            System.out.println("*********************");
            int i = scanner.nextInt();
            switch (i) {
                case 1:
                    Stu stu = new Stu();
                    stu.save(new User());
                    Thread.sleep(100);
                    break;
                case 2:
                    Stu stu2 = new Stu();
                    stu2.selectAll();
                    break;
                case 3:
                    Stu stu3 = new Stu();
                    stu3.updateUser(new User());
                    break;
                case 4:
                    Stu stu5 = new Stu();
                    stu5.delete(new User());
                    break;
                case 5:
                    Stu stu6 = new Stu();
                    stu6.selectOne(new User());
                    break;
                case 0:
                    System.out.println("退出");
                    System.exit(0);
                    break;
                default:
                    System.out.println("输入错误");
            }

        }


    }
}
